/*
 * $Id: MessageSenderImpl.java,v 1.2 2009/07/24 18:28:17 oliver Exp $
 *
 * Copyright (C) 2006 General Electric Company. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 *
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */

/**
 * 
 */
package com.ge.healthcare.autosc.common.message.sender;

import javax.jms.Destination;

import org.springframework.jms.core.JmsTemplate;

/**
 * @author 212042764
 * 
 */
public class MessageSenderImpl implements MessageSender {

	/**
	 * JMS Template to be used for sending messages
	 */
	private JmsTemplate jmsTemplate;

	/**
	 * Destination to send the message to
	 */
	private Destination destination;

	/**
	 * The method accepts the object to be sent to the destination configured in application context
	 * @param object - Object to be sent to the queue
	 */
	public void sendToQueue(Object object) {
		jmsTemplate.convertAndSend(destination, object);
	}

	/**
	 * @param destination
	 *            the destination to set
	 */
	public void setDestination(Destination destination) {
		this.destination = destination;
	}

	/**
	 * @param jmsTemplate
	 *            the jmsTemplate to set
	 */
	public void setJmsTemplate(JmsTemplate jmsTemplate) {
		this.jmsTemplate = jmsTemplate;
	}
}
